Optimal. Leaf size=85 \[ -\frac {(a-2 b) \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}-\frac {b^{3/2} \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a^2 \sqrt {a+b} d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3265, 425, 536,
212, 214} \begin {gather*} -\frac {b^{3/2} \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a+b}}-\frac {(a-2 b) \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 214
Rule 425
Rule 536
Rule 3265
Rubi steps
\begin {align*} \int \frac {\csc ^3(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {1}{\left (1-x^2\right )^2 \left (a+b-b x^2\right )} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {\text {Subst}\left (\int \frac {a-b-b x^2}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\cos (c+d x)\right )}{2 a d}\\ &=-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {(a-2 b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{2 a^2 d}-\frac {b^2 \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{a^2 d}\\ &=-\frac {(a-2 b) \tanh ^{-1}(\cos (c+d x))}{2 a^2 d}-\frac {b^{3/2} \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a^2 \sqrt {a+b} d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.46, size = 224, normalized size = 2.64 \begin {gather*} -\frac {(2 a+b-b \cos (2 (c+d x))) \csc ^2(c+d x) \left (-8 b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )-8 b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )+\sqrt {-a-b} \left (a \csc ^2\left (\frac {1}{2} (c+d x)\right )+4 (a-2 b) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-a \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )\right )}{16 a^2 \sqrt {-a-b} d \left (b+a \csc ^2(c+d x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 107, normalized size = 1.26
method | result | size |
derivativedivides | \(\frac {\frac {1}{4 a \left (\cos \left (d x +c \right )-1\right )}+\frac {\left (a -2 b \right ) \ln \left (\cos \left (d x +c \right )-1\right )}{4 a^{2}}-\frac {b^{2} \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a^{2} \sqrt {\left (a +b \right ) b}}+\frac {1}{4 a \left (1+\cos \left (d x +c \right )\right )}+\frac {\left (-a +2 b \right ) \ln \left (1+\cos \left (d x +c \right )\right )}{4 a^{2}}}{d}\) | \(107\) |
default | \(\frac {\frac {1}{4 a \left (\cos \left (d x +c \right )-1\right )}+\frac {\left (a -2 b \right ) \ln \left (\cos \left (d x +c \right )-1\right )}{4 a^{2}}-\frac {b^{2} \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a^{2} \sqrt {\left (a +b \right ) b}}+\frac {1}{4 a \left (1+\cos \left (d x +c \right )\right )}+\frac {\left (-a +2 b \right ) \ln \left (1+\cos \left (d x +c \right )\right )}{4 a^{2}}}{d}\) | \(107\) |
risch | \(\frac {{\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 a d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 a d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {i \sqrt {-\left (a +b \right ) b}\, b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{2 \left (a +b \right ) d \,a^{2}}+\frac {i \sqrt {-\left (a +b \right ) b}\, b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{2 \left (a +b \right ) d \,a^{2}}\) | \(238\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.54, size = 120, normalized size = 1.41 \begin {gather*} \frac {\frac {2 \, b^{2} \log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a^{2}} + \frac {2 \, \cos \left (d x + c\right )}{a \cos \left (d x + c\right )^{2} - a} - \frac {{\left (a - 2 \, b\right )} \log \left (\cos \left (d x + c\right ) + 1\right )}{a^{2}} + \frac {{\left (a - 2 \, b\right )} \log \left (\cos \left (d x + c\right ) - 1\right )}{a^{2}}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 327, normalized size = 3.85 \begin {gather*} \left [\frac {2 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \sqrt {\frac {b}{a + b}} \log \left (-\frac {b \cos \left (d x + c\right )^{2} - 2 \, {\left (a + b\right )} \sqrt {\frac {b}{a + b}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) + 2 \, a \cos \left (d x + c\right ) - {\left ({\left (a - 2 \, b\right )} \cos \left (d x + c\right )^{2} - a + 2 \, b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a - 2 \, b\right )} \cos \left (d x + c\right )^{2} - a + 2 \, b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )}}, \frac {4 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \sqrt {-\frac {b}{a + b}} \arctan \left (\sqrt {-\frac {b}{a + b}} \cos \left (d x + c\right )\right ) + 2 \, a \cos \left (d x + c\right ) - {\left ({\left (a - 2 \, b\right )} \cos \left (d x + c\right )^{2} - a + 2 \, b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a - 2 \, b\right )} \cos \left (d x + c\right )^{2} - a + 2 \, b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{3}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 196 vs.
\(2 (73) = 146\).
time = 0.43, size = 196, normalized size = 2.31 \begin {gather*} \frac {\frac {8 \, b^{2} \arctan \left (\frac {b \cos \left (d x + c\right ) + a + b}{\sqrt {-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt {-a b - b^{2}}}\right )}{\sqrt {-a b - b^{2}} a^{2}} + \frac {2 \, {\left (a - 2 \, b\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a^{2}} + \frac {{\left (a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}{a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}} - \frac {\cos \left (d x + c\right ) - 1}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 13.91, size = 592, normalized size = 6.96 \begin {gather*} -\frac {a\,\left (b\,\cos \left (c+d\,x\right )-b\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )+b\,{\cos \left (c+d\,x\right )}^2\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )\right )+a^2\,\left (\cos \left (c+d\,x\right )+\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )-{\cos \left (c+d\,x\right )}^2\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )\right )-2\,b^2\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )+\mathrm {atan}\left (\frac {-a\,\cos \left (c+d\,x\right )\,{\left (b^4+a\,b^3\right )}^{3/2}\,4{}\mathrm {i}-b\,\cos \left (c+d\,x\right )\,{\left (b^4+a\,b^3\right )}^{3/2}\,8{}\mathrm {i}+b^5\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,8{}\mathrm {i}+a^2\,b^3\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,1{}\mathrm {i}-a^3\,b^2\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,2{}\mathrm {i}+a\,b^4\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,12{}\mathrm {i}+a^4\,b\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,1{}\mathrm {i}}{-a^5\,b^2+a^4\,b^3+5\,a^3\,b^4+3\,a^2\,b^5}\right )\,\sqrt {b^4+a\,b^3}\,2{}\mathrm {i}+2\,b^2\,{\cos \left (c+d\,x\right )}^2\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )-{\cos \left (c+d\,x\right )}^2\,\mathrm {atan}\left (\frac {-a\,\cos \left (c+d\,x\right )\,{\left (b^4+a\,b^3\right )}^{3/2}\,4{}\mathrm {i}-b\,\cos \left (c+d\,x\right )\,{\left (b^4+a\,b^3\right )}^{3/2}\,8{}\mathrm {i}+b^5\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,8{}\mathrm {i}+a^2\,b^3\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,1{}\mathrm {i}-a^3\,b^2\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,2{}\mathrm {i}+a\,b^4\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,12{}\mathrm {i}+a^4\,b\,\cos \left (c+d\,x\right )\,\sqrt {b^4+a\,b^3}\,1{}\mathrm {i}}{-a^5\,b^2+a^4\,b^3+5\,a^3\,b^4+3\,a^2\,b^5}\right )\,\sqrt {b^4+a\,b^3}\,2{}\mathrm {i}}{d\,\left (-2\,a^3\,{\cos \left (c+d\,x\right )}^2+2\,a^3-2\,b\,a^2\,{\cos \left (c+d\,x\right )}^2+2\,b\,a^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________